@layout("/common/_container.html"){
<div class="layui-card">
	<div class="layui-form layui-card-header layuiadmin-card-header-auto">
	  <div class="layui-form-item">
	    <div class="layui-inline">
	      	<label class="layui-form-label">账号状态</label>
			<div class="layui-input-block">
			  <select name="status"	id="status">
				<option value="">账号状态</option>
				<option value="0">在线</option>
				<option value="1">离线</option>
			  </select>
			</div>
	    </div>
	    <div class="layui-inline">
	    	<label class="layui-form-label">日志时间</label>
	    	<div class="layui-input-inline">
	    		<input type="text" name="logTime" id="logTime" autocomplete="off" placeholder="日志时间" class="layui-input"/>
	    	</div>
	    </div>
	    <div class="layui-inline">
	      <button class="layui-btn layuiadmin-btn-useradmin" data-type="reload">
	        <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
	      </button>
	    </div>
	  </div>
	</div>
    <div class="layui-card-body">
    <table class="layui-hidden" id="table" lay-filter="table"></table>
    </div>
</div>

<script>
layui.config({
	base: Feng.ctxPath + "/static/layuiadmin/" //静态资源所在路径
}).extend({
	index: 'lib/index' //主入口模块
}).use(['index', 'layer','table', 'form','laydate'],function(){
	
	var $ = layui.$
  	,form = layui.form
  	,table = layui.table
	,laydate=layui.laydate;
	
	laydate.render({
        elem: '#logTime'
        ,showBottom: false
    });
	
	var loadingIndex = layer.msg('数据加载中', {icon: 16, time: 0 });
	table.render({
	    elem: '#table'
	    ,url: Feng.ctxPath + '/account_log/list'
	    ,cellMinWidth: 100
	    ,height: 'full-168' //设置高度
	    ,cols: [[
	        {title: '账号', field: 'login'},
	        {title: '账号状态', field: 'status'},
	        {title: '日志时间', field: 'logTime'}
	    ]]
	    ,page:true
	    ,loading:true
	    ,text: {
	        none: '暂无相关数据' 
	      }
	    ,done: function(res){
	    	layer.close(loadingIndex);
        }
	});
	
	//事件
	var active = {
		//加载
	   	reload: function(){
	       var status = $('#status').val();
	       var logTime = $('#logTime').val();
	       var loadingIndex = layer.msg('数据加载中', {icon: 16, time: 0 });
	       //执行表格重载
	       table.reload('table', {
	    	 height: 'full-168' //设置高度
	    	 ,where: {
	    		 status: status,
	    		 logTime: logTime
	         }
	       ,page:true
	       ,done: function(res){
		    	layer.close(loadingIndex);
	        }
	      });
	    }
   };
  
   
   $('.layui-btn.layuiadmin-btn-useradmin').on('click', function(){
     var type = $(this).data('type');
     active[type] ? active[type].call(this) : '';
   });
});

</script>
@}
